@use "logo";
@import "../../styles/lib/icon";
@import "../../styles/lib/widget";

.weather-widget {
  position: relative;
  color: #fff;
}

.weather-image {
  &.shrink {
    transform: scale(0.5);
    transform-origin: 100% 0;
  }
}

.loading {
  width: 48px;
  height: 48px;
  margin: 10px calc(50% - 24px);
}

.location {
  overflow-x: auto;
  font-size: 14px;
  line-height: 2;
}

.current {
  margin: 0 4px;
  font-weight: bold;
  font-size: 32px;
}

.air,
.wind,
.alarm {
  margin: 2px 4px;
  padding: 2px 4px;
  border-radius: 4px;

  background-color: rgb(127 127 127 / 25%);

  font-size: 12px;
  line-height: 1.25;
}

.icon {
  width: 24px;
  height: 24px;
}

.hours {
  display: flex;
  align-items: stretch;
  height: 66px;
  margin-top: 10px;

  .item {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    width: 48px;

    line-height: 1;
    text-align: center;
  }

  .time {
    font-size: 12px;
  }

  .degree {
    font-size: 14px;
  }
}

/* 天预报 */
.days {
  position: relative;

  display: flex;
  justify-content: space-evenly;

  height: 80px;

  text-align: center;

  .item {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;

    font-size: 12px;
  }
}

.today.small {
  .main-info,
  .sub-info {
    display: flex;
    align-items: center;
  }

  .status {
    margin: 2px 0 0 2px;
    font-size: 18px;
  }

  .sub-info {
    flex-wrap: wrap;
    justify-content: start;
    font-size: 14px;
  }
}

.today.medium {
  .top-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
  }

  .alarm,
  .air,
  .wind {
    float: right;
  }

  .main-info {
    display: flex;
    align-items: flex-end;
    justify-content: start;
  }

  .placeholder {
    flex: 1;
    margin: 0 0 0 auto;
  }

  .current-icon {
    width: 32px;
    height: 32px;
  }

  .status,
  .range {
    margin: 0 4px;
    font-size: 18px;
  }
}

.recent.small {
  .location {
    line-height: 1;
  }

  .main-info {
    display: flex;
    align-items: center;
  }

  .status {
    margin: 2px 0 0 2px;
    font-size: 18px;
  }

  .days {
    overflow-x: auto;
  }
}

.recent.medium {
  .air,
  .wind,
  .alarm {
    float: right;
  }

  .body {
    display: flex;
    flex: 1;
    align-items: stretch;
  }

  .info {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;

    width: 80px;
    margin: 0 12px 12px 0;
  }

  .main-info {
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .current-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto;
  }

  .status,
  .range {
    margin: 0 4px;
    font-size: 18px;
  }

  .range {
    white-space: nowrap;
  }

  .days-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    height: 116px;
  }

  .days {
    position: absolute;
    width: auto;
    height: 116px;
  }

  .item {
    min-width: 66px;
  }
}

.recent.large {
  .current-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;
  }

  .main-info {
    display: flex;
    align-items: center;
  }

  .status,
  .range {
    margin: 0 4px;
    font-size: 18px;
  }

  .day-list {
    margin-top: 8px;
  }

  .day-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    font-size: 13px;
  }

  .icons {
    flex: 1;
    text-align: center;
  }
}
